home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume2 / help < prev    next >
Encoding:
Internet Message Format  |  1991-08-07  |  33.0 KB

  1. From: wnp@killer.UUCP (Wolf Paul)
  2. Newsgroups: comp.sources.misc
  3. Subject: v02i018: A help command
  4. Message-ID: <7129@ncoast.UUCP>
  5. Date: 26 Jan 88 03:55:38 GMT
  6. Approved: allbery@ncoast.UUCP
  7.  
  8. Comp.sources.misc: Volume 2, Issue 18
  9. Submitted-By: Wolf Paul (wnp@killer.UUCP)
  10. Archive-Name: help
  11.  
  12. I have received several requests to post this to comp.sources.misc,
  13. so I am sending it on to you.
  14.  
  15. Wolf N. Paul
  16. ihnp4!killer!wnp
  17. -------
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of shell archive."
  25. # Contents:  Makefile README help.c help.man helpfile info
  26. # Wrapped by wnp@killer on Thu Jan 21 12:24:12 1988
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f Makefile -a "${1}" != "-c" ; then 
  29.   echo shar: Will not over-write existing file \"Makefile\"
  30. else
  31. echo shar: Extracting \"Makefile\" \(919 characters\)
  32. sed "s/^X//" >Makefile <<'END_OF_Makefile'
  33. X#
  34. X# Makefile for Help command
  35. X#
  36. X#    By:        $Author: plocher $  (John Plocher)
  37. X#            $Revision: 1.0 $
  38. X#    Last modified:    $Date: 87/12/26 23:34:30 $
  39. X#    Source is in:    $Source: /u/microport/src/help/RCS/Makefile,v $
  40. X#
  41. X#    Release state:    $State: Posted $
  42. X#
  43. X# Modification Log
  44. X# ----------------
  45. X#
  46. X# $Log:    Makefile,v $
  47. X# Revision 1.0  87/12/26  23:34:30  plocher
  48. X# Initial revision
  49. X# 
  50. X#
  51. X#    $Header: Makefile,v 1.0 87/12/26 23:34:30 plocher Posted $
  52. X#
  53. X
  54. XSHELL=/bin/sh
  55. X
  56. X# Where you put your local binaries...
  57. XLOCAL= /usr/local
  58. XHELPDIR= /usr/lib
  59. X
  60. Xall:    help
  61. X
  62. Xhelp:    help.o
  63. X    cc -o help help.o
  64. X
  65. Xinstall: all
  66. X    chown root help
  67. X    chmod 755 help
  68. X    chmod u+s help
  69. X    if [ -f /usr/bin/help ] ; then  mv /usr/bin/help /usr/bin/help.SV ; fi
  70. X    rm -f $(LOCAL)/help
  71. X    cp help $(LOCAL)
  72. X    chown root helpfile
  73. X    chmod 644 helpfile
  74. X    install -c $(HELPDIR) helpfile
  75. X
  76. Xuninstall:
  77. X    rm -f $(LOCAL)/help $(HELPDIR)/helpfile $(HELPDIR)/helpfile.idx
  78. X
  79. Xclean:
  80. X    rm -f help.o help
  81. END_OF_Makefile
  82. if test 919 -ne `wc -c <Makefile`; then
  83.     echo shar: \"Makefile\" unpacked with wrong size!
  84. fi
  85. # end of overwriting check
  86. fi
  87. if test -f README -a "${1}" != "-c" ; then 
  88.   echo shar: Will not over-write existing file \"README\"
  89. else
  90. echo shar: Extracting \"README\" \(2334 characters\)
  91. sed "s/^X//" >README <<'END_OF_README'
  92. XSubject: 286 Source: A Help Command for systems with limited disk space
  93. XMessage-Id: <8712221357.AA29111@killer.UUCP>
  94. XDate: 22 Dec 87 13:57:22 CST (Tue)
  95. X
  96. XRCSINFO: $Header: README,v 1.0 87/12/18 18:22:29 wnp Posted $
  97. X
  98. XThe enclosed is a "help" command, patterned after the help command
  99. Xdistributed with MKS Toolkit -- in fact, if you have the Toolkit,
  100. Xyou could use their helpfile as a starting point for a UNIX SysV
  101. Xhelpfile.
  102. X
  103. XIf you don't have the Toolkit, you can construct a helpfile by
  104. Xgleaning short command descriptions from your manual, and adding
  105. Xthem to "/usr/lib/helpfile", according the the pattern of the partial
  106. Xhelpfile shown below.
  107. X
  108. XI find this help command more useful than the help system distributed with
  109. XSystem V, especially on machines with limited disk space, where it is not
  110. Xpractical to keep the manuals on-line.
  111. X
  112. XThe program uses an indexfile, /usr/lib/helpindex, to speed up access;
  113. Xif the indexfile does not exist, or is older than /usr/lib/helpfile (indicating
  114. Xthat the helpfile has been updated), the program will build a new indexfile.
  115. X
  116. XCompile normally, (small model on Uport V/286), then invoke as "help". The
  117. Xprogram should be owned by root and suid, so it can write in /usr/lib (to
  118. Xrecreate the index file as needed.).
  119. X
  120. XThe helpfile below consists of those help entries which I have added to
  121. Xthe MKS Toolkit file to use with my UNIX system. I do not feel free to
  122. Xpost the MKS helpfile, since it is no doubt (c) by MKS.
  123. X
  124. XPut the helpfile into /usr/lib/helpfile, or change the references thereto in
  125. Xhelp.c.
  126. X
  127. XI hope this is helpful. Civil and constructive comments are invited to
  128. Xihnp4!killer!dcs!wnp, flames should be directed to /dev/null.
  129. X
  130. XWolf N. Paul
  131. Xihnp4!killer!dcs!wnp
  132. X
  133. X
  134. XP.S. Since first posting this to comp.unix.microport, another application
  135. Xhas been suggested for this command - an online, free-form notebook.
  136. X
  137. XActually, any kind of information can be kept in a "helpfile" for this
  138. Xcommand, as long as each item of info starts with a line containing
  139. X'#' and a number of keywords separated by commas (currently each keyword
  140. Xmust be less than 14 characters long and cannot contain white space).
  141. XJohn Plocher's addition of looking at $HELPDIR and $HELPFILE permits one
  142. Xto put info into a file $HOME/.notebook, and to access it using the enclosed
  143. X"info" shellscript.
  144. X
  145. XAgain, i hope this i helpful.
  146. END_OF_README
  147. if test 2334 -ne `wc -c <README`; then
  148.     echo shar: \"README\" unpacked with wrong size!
  149. fi
  150. # end of overwriting check
  151. fi
  152. if test -f help.c -a "${1}" != "-c" ; then 
  153.   echo shar: Will not over-write existing file \"help.c\"
  154. else
  155. echo shar: Extracting \"help.c\" \(6250 characters\)
  156. sed "s/^X//" >help.c <<'END_OF_help.c'
  157. X/*
  158. X * Name:    help.c
  159. X * Purpose: display help about commands & system features
  160. X * Syntax:  help [cmd]
  161. X * Comment: Help displays help screens on all user commands
  162. X *          as set up in the file /usr/lib/helpfile.
  163. X *          It is particularly useful on systems with restricted 
  164. X *          diskspace, where it is not practical to keep the manuals
  165. X *          on-line.
  166. X *          The command is patterned after the MKS Toolkit command
  167. X *          of the same name. If no /usr/lib/helpindex file exists, or if
  168. X *          it is older than the helpfile, a new helpindex will be
  169. X *          created to allow faster access to the helpscreens by
  170. X *          means of fseek().
  171. X *          Desirable enhancements would include the possibility to
  172. X *          have help look in an environment variable HELPFILE for
  173. X *          an alternate or additional helpfile,
  174. X *              [ Done by John Plocher - uses HELPDIR to set the directory
  175. X *              where the help file and its index are.  It also uses HELPFILE
  176. X *              to give the name of the data file ($HELPFILE.idx is the index)
  177. X *              defaults are "/usr/lib" and "helpfile" ]
  178. X *          and/or to have help look in $HOME/.helpfile if a command
  179. X *          is not found in the default helpfile.
  180. X *          Another useful feature would be the possibility of using
  181. X *          a pager specified by $PAGER to output the help info, since
  182. X *          a few entries (stty, vi, ...) are longer than one screen.
  183. X *          No doubt the coding could be considerably improved, and
  184. X *          any suggestions would be more than welcome.
  185. X * Author:  Wolf Paul, ihnp4!killer!dcs!wnp
  186. X * Date:    Dec. 18, 1987
  187. X *
  188. X *    Revision Control Information
  189. X *
  190. X *    Last edited by:    $Author: plocher $
  191. X *            $Revision: 1.1 $
  192. X *    Last modified:    $Date: 87/12/26 23:34:50 $
  193. X *    Source is in:    $Source: /u/microport/src/help/RCS/help.c,v $
  194. X *
  195. X *    Release state:    $State: Posted $
  196. X *
  197. X * Modification Log
  198. X * ----------------
  199. X *
  200. X *    $Log:    help.c,v $
  201. X *    Revision 1.1  87/12/26  23:34:50  plocher
  202. X *    Added enviroment variables for HELPDIR and HELPFILE
  203. X *    
  204. X */
  205. X
  206. X#ifndef lint
  207. X    static char rcsid[] =
  208. X     "$Header: help.c,v 1.1 87/12/26 23:34:50 plocher Posted $";
  209. X#endif
  210. X
  211. X#include <stdio.h>
  212. X#include <ctype.h>
  213. X#include <sys/types.h>
  214. X#include <sys/stat.h>
  215. X
  216. X#define MAXLINE     134
  217. X#define HELPDIR        "/usr/lib"        /* Added by John Plocher */
  218. X#define HELPFILE    "helpfile"        /* .. */
  219. X#define INDEX        ".idx"            /* .. */
  220. X
  221. Xchar helpfilename[128];        /* John Plocher */
  222. Xchar helpidxname[128];        /* .. */
  223. X
  224. Xmain(argc, argv)
  225. Xint argc;
  226. Xchar **argv;
  227. X{
  228. X    struct
  229. X    {
  230. X        char name[15];
  231. X        long offset;
  232. X    } entry;                /* helpindex entries for each command */
  233. X
  234. X    struct stat sbuf1, sbuf2;    /* stat buffers for helpfile & helpindex */
  235. X    char *command, *line, Line[MAXLINE];
  236. X    register char    *cp;        /* John Plocher */
  237. X    extern char    *getenv();        /* .. */
  238. X    int status;
  239. X    FILE *ifp, *hfp;        /* file pointers for helpfile and helpindex */
  240. X    
  241. X    if ( argc == 1 )        /* If no arguments, ... */
  242. X        command = "help";    /* ... default to "help help" */
  243. X    else
  244. X        command = argv[1];    /* else look for command in argv[1] */
  245. X
  246. X
  247. X    /*        Added by John Plocher Sat Dec 26 22:02:09 CST 1987
  248. X     * Look for:
  249. X     *    getenv("HELPDIR") + getenv("HELPFILE")
  250. X     *    getenv("HELPDIR") + "helpfile"
  251. X     *    "/usr/lib"          + getenv("HELPFILE")
  252. X     *    "/usr/lib"          + "helpfile"
  253. X     */
  254. X    if ((cp = getenv("HELPDIR")) != NULL)    /* if a dir is given, use it */
  255. X        strcpy(helpidxname, cp);
  256. X    else
  257. X        strcpy(helpidxname, HELPDIR);
  258. X    strcpy(helpfilename, helpidxname);
  259. X    strcat(helpfilename, "/");
  260. X
  261. X    if ((cp = getenv("HELPFILE")) != NULL)    /* if a filename is given, use it */
  262. X        strcat(helpfilename, cp);
  263. X    else
  264. X        strcat(helpfilename, HELPFILE);
  265. X
  266. X    strcpy(helpidxname, helpfilename);        /* make a name for the index file */
  267. X    strcat(helpidxname, INDEX);
  268. X
  269. X    stat(helpfilename, &sbuf1);    /* get mtime for helpfile */
  270. X    status=access(helpidxname, 0);
  271. X    if ( status == 0 )    /* if helpindex exists ... */
  272. X    {
  273. X        stat(helpidxname, &sbuf2);    /* get mtime for helpindex */
  274. X    }
  275. X    if ( (status != 0) ||             /* if there is no helpindex ... */
  276. X        ((time_t)sbuf1.st_mtime > (time_t)sbuf2.st_mtime) )
  277. X                                    /* or if it is older than helpfile */
  278. X    {
  279. X        buildindex();        /* build a new helpindex */
  280. X    }
  281. X
  282. X    if ( (ifp=fopen(helpidxname, "r")) == NULL )
  283. X    {
  284. X        fprintf(stderr, "Can't read %s\n", helpidxname);
  285. X        exit(-1);
  286. X    }
  287. X    
  288. X    while ( 1 )        /* look for index entry for "command" */
  289. X    {
  290. X        status=fread(&entry, sizeof(entry), 1, ifp);
  291. X        if ( status==0 ) /* quit at end of index file */
  292. X        {
  293. X            fprintf(stderr, "No help for %s\n", command);
  294. X            fclose(ifp);
  295. X            exit(1);        }
  296. X        if ( strcmp(entry.name, command) == 0 ) /* quit when we find it */
  297. X        {
  298. X            fclose(ifp);
  299. X            break;
  300. X        }
  301. X    }
  302. X
  303. X    if ((hfp=fopen(helpfilename, "r")) == NULL )
  304. X    {
  305. X        fprintf(stderr, "Can't open %s\n", helpfilename);
  306. X        exit(-1);
  307. X    }
  308. X
  309. X    fseek(hfp, entry.offset, 0);    /* go to the help entry */
  310. X
  311. X    while ( 1 )            /* just copy lines to stdout */
  312. X    {
  313. X        line = fgets(Line, MAXLINE, hfp);
  314. X        if ( line == (char *) NULL || line[0] == '#' )
  315. X                        /* until another entry starts */
  316. X            break;
  317. X        fputs(line,stdout);
  318. X    }
  319. X
  320. X    fclose(hfp);
  321. X}
  322. X
  323. Xbuildindex()
  324. X{
  325. X    FILE *hfp, *ifp;
  326. X    struct {
  327. X        char name[15];
  328. X        long offset;
  329. X    } entry;
  330. X    char Line[MAXLINE];
  331. X    char *line;
  332. X    int i,j;
  333. X
  334. X
  335. X    unlink(helpidxname); /* remove old index file */
  336. X    if ( (hfp=fopen(helpfilename, "r")) == NULL )
  337. X    {
  338. X        fprintf(stderr,"buildindex: Can't read %s\n", helpfilename);
  339. X        exit(-1);
  340. X    }
  341. X    if ( (ifp=fopen(helpidxname, "w")) == NULL )
  342. X    {
  343. X        fprintf(stderr, "buildindex: Can't write %s\n", helpidxname);
  344. X        exit(-1);
  345. X    }
  346. X
  347. X    while (1)    /* Read thru helpfile ... */
  348. X    {
  349. X        entry.offset=(long) 0;
  350. X        line = fgets(Line, MAXLINE, hfp);
  351. X        if ( line == (char *) NULL ) break;
  352. X        if ( line[0] == '#' )    /* and for each help entry ... */
  353. X        {
  354. X            line++;
  355. X            while ( isspace(line[0]) ) line++;
  356. X            i=j=0;
  357. X            while ( line[i] != '\0' )
  358. X            {
  359. X                if ( line[i] == '\n' ) break;
  360. X                while ( line[i] == ' ' || line[i] == ',' ) i++;
  361. X                while ( !isspace(line[i] ) &&
  362. X                        line[i] != ',') /* save its name ... */
  363. X                {
  364. X                    entry.name[j] = line[i];
  365. X                    i++; j++;
  366. X                }
  367. X                while ( j < 15 )
  368. X                    entry.name[j++] = '\0';
  369. X                j = 0;
  370. X                entry.offset=ftell(hfp);    /* and its offset ... */
  371. X                fwrite(&entry, sizeof(entry), 1, ifp);
  372. X                                        /* and write it to indexfile */
  373. X            }
  374. X        }
  375. X    }
  376. X    fclose(hfp);
  377. X    fclose(ifp);
  378. X}
  379. END_OF_help.c
  380. if test 6250 -ne `wc -c <help.c`; then
  381.     echo shar: \"help.c\" unpacked with wrong size!
  382. fi
  383. # end of overwriting check
  384. fi
  385. if test -f help.man -a "${1}" != "-c" ; then 
  386.   echo shar: Will not over-write existing file \"help.man\"
  387. else
  388. echo shar: Extracting \"help.man\" \(1289 characters\)
  389. sed "s/^X//" >help.man <<'END_OF_help.man'
  390. X.TH LA LOCAL "System V"
  391. X.SH NAME
  392. Xhelp \- Provide brief command explanations
  393. X.\" $Header: help.man,v 1.1 87/12/26 23:35:34 plocher Posted $
  394. X.SH SYNOPSIS
  395. X.B help
  396. X[
  397. X.B command
  398. X]
  399. X.SH DESCRIPTION
  400. X.I Help
  401. Xprints out a quick explanation of a command.
  402. X.SH INSTALLATION
  403. XThe
  404. X.B Makefile
  405. Xprovides entries for automatically installing (and un-installing) this
  406. Xpackage. 
  407. XYou need to be root to install 
  408. X.I "help.@@"
  409. X.I Make install
  410. Xwill completely install the needed files in the appropriate directories
  411. Xwith the needed permissions and ownership.
  412. X.I Make uninstall
  413. Xwill remove the effects of 
  414. X.I make install.
  415. X.SH BUGS
  416. X.PP
  417. XIf you have the MKS Toolkit, you could use their helpfile as a starting
  418. Xpoint for a UNIX SysV helpfile.
  419. X.PP
  420. XIf you don't have the Toolkit, you can construct a helpfile by
  421. Xgleaning short command descriptions from your manual, and adding
  422. Xthem to the helpfile, according the the pattern of the partial
  423. Xhelpfile provided.
  424. X.SH FILES
  425. X.nf
  426. X    /usr/lib/helpfile    default datafile containing help info
  427. X
  428. X    $HELPDIR        Environment variable - directory for helpfile
  429. X    $HELPFILE        Environment variable - alternate name for helpfile
  430. X.fi
  431. X.SH AUTHORS
  432. X.nf
  433. X    Original Author:
  434. X    uwmacc!harvard!killer!wnp (Wolf Paul)
  435. X    
  436. X    Environment variable handling by:
  437. X    plocher@uwspan.uucp (John Plocher)
  438. X
  439. END_OF_help.man
  440. if test 1289 -ne `wc -c <help.man`; then
  441.     echo shar: \"help.man\" unpacked with wrong size!
  442. fi
  443. # end of overwriting check
  444. fi
  445. if test -f helpfile -a "${1}" != "-c" ; then 
  446.   echo shar: Will not over-write existing file \"helpfile\"
  447. else
  448. echo shar: Extracting \"helpfile\" \(19018 characters\)
  449. sed "s/^X//" >helpfile <<'END_OF_helpfile'
  450. X# version
  451. X$Header: helpfile,v 1.1 87/12/26 23:35:43 plocher Posted $
  452. X# atob, btoa
  453. Xbtoa, atob -- encode/decode binary to printable ASCII
  454. XUsage:  btoa < infile > outfile
  455. X        cmd | btoa > outfile
  456. X    atob infile
  457. XBtoa is a filter that reads anything from the standard input, and encodes it
  458. Xinto printable ASCII on the standard output.  It also attaches a header and
  459. Xchecksum information used by the reverse filter atob to find the start of the
  460. Xdata and to check integrity.
  461. X
  462. XAtob reads an encoded file, strips off any leading and trailing lines added
  463. Xby mailers, and recreates a copy of the original file on the standard
  464. Xoutput.  Atob gives NO output (and exits with an error message) if its input
  465. Xis garbage or the checksums do not check.
  466. X# chmod
  467. Xchmod -- change file modes
  468. XUsage:    chmod mode file ...
  469. X
  470. XMode can be either SYMBOLIC or OCTAL.
  471. X
  472. XSYMBOLIC MODES:
  473. X    [who] op perm
  474. X
  475. Xwho:    `u' (user), `g' (group), `o' (others); `a' is equivalent to `ugo';
  476. X
  477. Xop:    + adds permission, - removes permission, = sets absolute permissions
  478. X
  479. Xperm:    `r' read, `w' write, `x' execute (or search for directories);
  480. X    Super-User only:
  481. X    `s' set UID or set GID; `t' save text/sticky bit.
  482. X
  483. XOCTAL MODES:
  484. X
  485. X    These are constructed by ORing the appropriate modes from this list:
  486. X    
  487. X    4000    Set UID (Superuser only)
  488. X    2000    Set GID (Superuser only)
  489. X    1000    Sticky Bit (Superuser only)
  490. X    0400    Read by Owner
  491. X    0200    Write by Owner
  492. X    0100    Execute by Owner
  493. X    0070    Read, Write, Execute by Group
  494. X    0007    Read, Write, Execute by Others
  495. X# chown
  496. Xchown, chgrp -- change owner or group
  497. XUsage:  chown user file(s)
  498. X    chgrp group file(s)
  499. X
  500. XUser and Group can be either a numerical UID or GID, or a login or group
  501. Xname found in the /etc/passwd and /etc/group files.
  502. X
  503. XOnly the owner of a file (or the Superuser) can change the owner or group
  504. Xof that file.
  505. X# col
  506. Xcol -- convert reverse and half line feeds from nroff
  507. XUsage:  col [-f -b -x -p] [file(s)]
  508. X-f      output device can perform forward half line feeds
  509. X-b      output device is cannot backspace
  510. X-x      do not output tabs for multiple spaces
  511. X-p      let unrecognized escape sequences (other than ESC 7, ESC 8, and
  512. X        ESC 9) pass.
  513. XCol is used to print nroff output on devices that cannot perform forward and
  514. Xreverse half line motions or reverse line feeds, as is the case with most
  515. Xsimple printers and CRT terminals. If no files are given, col reads standard
  516. Xinput.
  517. X# cu
  518. Xcu -- call another UNIX system
  519. XUsage:    cu [-s speed] [-l line] [-h] [-t] [-d] [-o|e] [-n] telno
  520. X    cu [-s speed] [-h] [-d] [-o|e] -l line
  521. X    cu [-h] [-d] [-o|e] systemname
  522. X-s    Specify transmission speed (300, 1200, 2400, 4800, 9600);
  523. X-l    Specify a line to be used
  524. X-h    Emulate local echo (half duplex)
  525. X-t    Map newline to CR/LF for ascii terminals
  526. X-d    Print diagnostic traces
  527. X-o    Generate odd parity on outgoing data
  528. X-e    Generate even parity on outgoing data
  529. X-n    Prompt for telephone number
  530. X
  531. XCommands start with `~' in the first column of a line:
  532. X~.    terminate the conversation
  533. X~!    escape to interactive shell on local system
  534. X~!cmd    run cmd locally (via sh -c)
  535. X~$cmd    run cmd locally and send its output to remote system
  536. X~%cd    change directory on local system
  537. X~%take    copy file1 on remote system to file2 on the local system.
  538. X    If file2 is not specified, the file will have the same name on the
  539. X    local system as on the remote system.
  540. X~%put    copy file1from the local system to file2 on the remote system.
  541. X    If file2 is not specified, the file will have the same name on the
  542. X    remote system as on the local system.
  543. X~~line    send the line "~line" to the remote system (to execute a cu command on
  544. X    the remote system)
  545. X~%break    transmit a BREAK to the remote system
  546. X~%debug    toggle debug option on/off
  547. X~t    print the values of the termio structure variables for the user's
  548. X    terminal
  549. X~l    print the values of the termio structure variables for the remote
  550. X    communications line
  551. X~%nostop  toggle between XON/XOFF input control protocol and no input control
  552. X# help
  553. Xhelp -- provide brief command explanations
  554. XUsage:    help [command]
  555. XLooks in $HELPDIR/$HELPFILE (/usr/lib/ and helpfile are the defaults) for
  556. Xexplanations of a command.
  557. X# lp, cancel
  558. Xlp, cancel -- send/cancel requests to an LP device
  559. XUsage:    lp [-c] [-d dest] [-m] [-n num] [-o opt] [-s] [-t title] [-w] [file(s)]
  560. X    cancel [ids] [devices]
  561. X-c    Copy files immediately instead of linking
  562. X-d    Choose dest as the printer or class of printers to do the printing.
  563. X-m    Send mail after files have been printed
  564. X-n    Print num copies
  565. X-o    Specify printer-dependent options
  566. X-s    Suppress messages from lp such as "request id is ..."
  567. X-t    Print title on the banner page of the output
  568. X-w    Write a message on the user's terminal when files have been printed.
  569. XCancel cancels line printer requests that were made with the lp command.
  570. XThe commandline arguments may be either request ids as returned by lp without
  571. Xthe -s option, or printer names (for a complete list do "lpstat").
  572. X# lpstat
  573. Xlpstat -- print LP status information
  574. XUsage:    lpstat [options]
  575. X-a list    Print acceptance status (with respect to lp) of destinations for
  576. X    requests. "List" is a list of intermixed printer and class names.
  577. X-c list    Print class names and their members. "List" is a list of class names.
  578. X-d    Print the default destination for lp.
  579. X-o list    Print the status of output requests. "List" is a list of intermixed
  580. X    printer names, class names, and request ids.
  581. X-p list    Print the status of printers. "List" is a list of printer names.
  582. X-r    Print the status of the LP request scheduler.
  583. X-s    Print a status summary
  584. X-t    Print all status information
  585. X-u list    Print status of output requests for users. "List" is a list of login
  586. X    names.
  587. X-v list    Print the names of printers and the pathnames of devices associated
  588. X    with them. "List" is a list of printer names.
  589. XIf "list" is omitted in the above options, all information relevant to the
  590. Xoption letter will be printed.
  591. X# mail, mailx
  592. Xmail, mailx -- electronic mail programs
  593. XUsage:    mail        # to check for mail
  594. X    mailx
  595. X    mail user    # to send mail to user
  596. X    mailx user
  597. XThe options and commands for these two programs are too numerous
  598. Xto list here. See the manual entries and tutorials if you need more information
  599. Xthan shown above.
  600. X# mesg
  601. Xmesg -- permit or deny messages
  602. XUsage:    mesg [-n] [-y]
  603. X-n    Forbid messages via write(1)
  604. X-y    Allow messages via write(1)
  605. XWithout options, mesg reports the current status.
  606. X# more
  607. Xmore -- file browser
  608. XUsage:    more file(s)
  609. X# newgrp
  610. Xnewgrp -- log in to a new group
  611. XUsage:    newgrp [-] [group]
  612. XInvokes a new shell with the group id set to the specified group.
  613. XWith argument `-', newgrp sets up the environment as if the user had
  614. Xactually logged in again as a member of the specified group.
  615. XWithout arguments, the group id is set back to that specified in /etc/passwd.
  616. X# nice
  617. Xnice -- run a command at a low priority
  618. XUsage:    nice [-increment] command [arguments]
  619. XNice executes command with a lower CPU scheduling priority. If no "increment"
  620. Xargument is given, a default of 10 is used.
  621. XOnly the Superuser may run commands with higher-than-usual priority by using
  622. Xa negative increment (e.g. --10).
  623. X# nohup
  624. Xnohup - run a command immune to hangups and quits
  625. XUsage:    nohup command [arguments]
  626. XIf nohup should apply to several commands, they should be placed in a file
  627. Xand invoked as "nohup sh commandfile".
  628. XIf the output from "command" is not redirected by the user, it will be placed
  629. Xinto a file nohup.out in the current or HOME directory of the user.
  630. X# nroff
  631. Xnroff -- text formatter for line printer devices
  632. XUsage:  nroff [options] [files]
  633. X-olist  print only pages listed; ranges are allowed
  634. X-nN     number first page N
  635. X-sN     stop every N pages to allow paper loading or
  636. X        changing. Resume upon receipt of a newline.
  637. X-raN    set register a (must be one-character name) to N.
  638. X-i      read standard input after files are exhausted
  639. X-q      invoke the simultaneous input-output mode of the .rd request
  640. X-z      print only messages generated by .tm (terminal message) requests
  641. X-mname    prepend to the input files the the non-compacted (ASCII text) macro file
  642. X    located in /usr/lib/tmac/tmac.name
  643. X-cname    prepend to the input files the compacted macro files located in
  644. X    /usr/lib/macros/cmp.[nt].[dt].name and 
  645. X    /usr/lib/macros/ucmp.[nt].name.
  646. X-kname    Compact the macros used in this invocation of nroff, placing the output
  647. X    in files [dt].name in the current directory. 
  648. X-Tname  prepare output for device name. Known names are 37 (Teletype 37,
  649. X        default), ascii (generic ascii printer w/o reverse linefeed),
  650. X        ansi (ansi or vt100 terminal), fx80 (Epson FX-80 printer),
  651. X        8510 (NEC 8510/C.Itoh dot matrix printer), 3550 (NEC Spinwriter),
  652. X        lp (generic ascii printer with reverse linefeed)
  653. X-e      produce equally-spaced words in adjusted lines, using full device
  654. X        resolution
  655. X-h      use output horizontal tabs to speed output and reduce output character
  656. X        count. Does not work with all printers.
  657. X-wn     set the embolding factor for Font 3 to n, or to zero if n is missing.
  658. X# otroff
  659. Xotroff -- text formatter for Wang Laboratories C/A/T photo typesetter
  660. XUsage:  otroff [options] [files]
  661. X-olist  print only pages listed; ranges are allowed
  662. X-nN     number first page N
  663. X-sN     stop every N pages to allow paper loading or
  664. X        changing. Resume when typesetter's start button is pressed.
  665. X-raN    set register a (must be one-character name) to N.
  666. X-i      read standard input after files are exhausted
  667. X-q      invoke the simultaneous input-output mode of the .rd request
  668. X-z      print only messages generated by .tm (terminal message) requests
  669. X-mname    prepend to the input files the the non-compacted (ASCII text) macro file
  670. X    located in /usr/lib/tmac/tmac.name
  671. X-cname    prepend to the input files the compacted macro files located in
  672. X    /usr/lib/macros/cmp.[nt].[dt].name and 
  673. X    /usr/lib/macros/ucmp.[nt].name.
  674. X-kname    Compact the macros used in this invocation of otroff, placing the output
  675. X    in files [dt].name in the current directory. 
  676. X-t    Direct output to the standard output instead of the phototypesetter.
  677. X-f    Refrain from feeding out paper and stopping the phototypesetter at the
  678. X    end of the run.
  679. X-w    Wait until phototypesetter is ready, if it is currently busy.
  680. X-b    Report on busy/ready status of phototypesetter. No text processing
  681. X    is done.
  682. X-a    Send a printable ASCII approximation of the result to the standard
  683. X    output.
  684. X-pN    print all characters in point size N while retaining all prescribed
  685. X    spacings and motions, to reduce phototypesetter elapsed time.
  686. X-Tcat    Use font-width tables for Wang C/A/T phototypesetter. This is both
  687. X    the default and the only choice.
  688. X# ps
  689. Xps -- display process status
  690. XUsage:    ps [options]
  691. X-e    Print information about all processes
  692. X-d    Print information about all processes, except process group leaders
  693. X-a    Print information about all processes, except process group leaders
  694. X    and processes not associated with a terminal
  695. X-f    Generate a full listing
  696. X-l    Generate a long listing
  697. X-cfile    Use the specified core file instead of /dev/mem
  698. X-sdev    Use the specified swap device instead of /dev/swap
  699. X-nfile    Use specified file instead of /unix
  700. X-tlist    Restrict listing to processes associated with terminals given in list.
  701. X-plist    Restrict listing to processes whose PIDs are given in list.
  702. X-ulist    Restrict listing to processes whose UIDs or LOGNAMEs are given in list.
  703. X-glist    Restrict listing to processes whose GIDs or GROUP names are given in
  704. X    list.
  705. X# sleep
  706. Xsleep -- suspend execution for a specified time
  707. XUsage:    sleep seconds
  708. X# strip
  709. Xstrip -- remove symbol table from COFF executable files
  710. XUsage:    strip [-l] [-x] [-r] [-V] file ...
  711. X-l    Strip line number information only; do not strip symbol table
  712. X-x    Do not strip static or external symbol information
  713. X-r    Reset relocation indexes
  714. X-V    Print strip Version information to standard error.
  715. XIf executed on an ar(1) archive, the archive symbol table will be removed.
  716. X# stty
  717. Xstty - set terminal characteristics and options
  718. XUsage:    stty [-a] [-g] [options]
  719. X-a    Report all current settings
  720. X-g    report current settings in a form that can be used as arguments
  721. X    for another stty command.
  722. XCONTROL MODES:
  723. Xparenb (-parenb)    enable (disable) parity generation & detection
  724. Xparodd (-parodd)    select odd (even) parity
  725. Xcs5 cs6 cs7 cs8        select character size (data bits)
  726. X0 110 300 600 1200 1800 2400 4800 9600
  727. X            select baudrate. 0 hangs up phone immediately.
  728. Xhupcl (-hupcl)        hangup (don't hangup) dataphone on last close
  729. Xhup (-hup)        same as hupcl (-hupcl)
  730. Xcstopb (-cstopb)    use two (one) stop bits per character
  731. Xcread (-cread)        enable (disable) the receiver
  732. Xclocal (-clocal)    assume a line without (with) modem control
  733. Xloblk (-loblk)        block (don't block) output from non-current layer
  734. XINPUT MODES:
  735. Xignbrk (-ignbrk)    ignore (don't ignore) break on input
  736. Xbrkint (-brkint)    signal (don't signal) INTR on break
  737. Xignpar (-ignpar)    ignore (don't ignore) parity errors
  738. Xparmrk (-parmrk)    mark (don't mark) parity errors
  739. Xinpck (-inpck)        enable (disable) input parity checking
  740. Xistrip (-istrip)    strip (don't strip) input characters to 7 bits
  741. Xinlcr (-inlcr)        map (don't map) NL to CR on input
  742. Xigncr (-igncr)        ignore (don't ignore) CR on input
  743. Xicrnl (-icrnl)        map (don't map) CR to NL on input
  744. Xiuclc (-iuclc)        map (don't map) upper case to lower case on input
  745. Xixon (-ixon)        enable (disable) XON/XOFF output control
  746. Xixany (-ixany)        allow any character (only XON) to restart output
  747. Xixoff (-ixoff)        request that system send (not send) XON/XOFF
  748. X            characters when input queue is nearly empty/full.
  749. XOUTPUT MODES
  750. Xopost (-opost)        post-process output (do not post-process output; ignore
  751. X            all other output modes)
  752. Xolcuc (-olcuc)        map (don't map) lower case to upper case on output
  753. Xonlcr (-onlcr)        map (don't map) NL to CR-NL on output
  754. Xocrnl (-ocrnl)        map (don't map) CR to NL on output
  755. Xonocr (-onocr)        do not (do) output CR at column 0
  756. Xonlret (-onlret)    on the terminal, NL performs (doesn't perform) the
  757. X            RETURN function
  758. Xofill (-ofill)        use fill characters (use timing) for delays
  759. Xofdel (-ofdel)        fill characters are DELs (NULs)
  760. Xcr0 cr1 cr2 cr3        set style of delay for CRs
  761. Xnl0 nl1            set style of delay for LFs
  762. Xtab0 tab1 tab2 tab3    set style of delay for horizontal tabs
  763. Xbs0 bs1            set style of delay for backspaces
  764. Xff0 ff1            set style of delay for formfeeds
  765. Xvt0 vt1            set style of delay for vertical tabs
  766. X
  767. XLOCAL MODES
  768. Xisig (-isig)        enable (disable) interpretation of special control
  769. X            characters INTR, QUIT, ans  SWTCH.
  770. Xicanon (-icanon)    enable (disable) canonical input (ERASE and KILL
  771. X            processing)
  772. Xxcase (-xcase)        canonical (unprocessed) upper/lower case presentation
  773. Xecho (-echo)        echo back (don't echo back) every character typed
  774. Xechoe (-echoe)        echo (don't echo) ERASE as a backspace-space-backspace
  775. X            string
  776. Xechok (-echok)        echo (don't echo) NL after KILL character
  777. Xlfkc (-lfkc)        same as echok (-echok) -- obsolete.
  778. Xechonl (-echonl)    echo (don't echo) NL
  779. Xnoflsh (-noflsh)    disable (enable) flush after INTR, QUIT, or SWTCH
  780. Xstwrap (-stwrap)    disable (enable) truncation of lines longer than 79
  781. X            characters on a synchronous line
  782. Xstflush (-stflush)    enable (disable) flush on synchronous line after every
  783. X            write(2)
  784. Xstappl (-stappl)    use application mode (use line mode) on a synchronous
  785. X            line
  786. X
  787. XCONTROL ASSIGNMENTS
  788. Xcontrol-char c        set control-char to c, where control-char is one of:
  789. X            erase, kill, intr, quit, swtch, eof, ctab, min, or time
  790. X            If c is preceded by an (escaped from the shell) caret
  791. X            (^), then the value used is the corresponding CTRL 
  792. X            character (e.g. "^d" is CTRL-D); "^?" is DEL.
  793. Xline i            set line discipline to i ( 0 < i < 127 ).
  794. X
  795. XCOMBINATION MODES
  796. Xevenp or parity        parenb cs7
  797. Xoddp            parenb cs8 parodd
  798. X-parity            -parenb cs8
  799. X-evenp            -parenb cs8
  800. X-oddp            -parenb cs8
  801. Xraw (-raw or cooked)    enable (disable) raw input and output (no ERASE, KILL,
  802. X            INTR, QUIT, SWTCH, EOT, or output post processing).
  803. Xnl (-nl)        unset (set) icrnl, onlcr. In addition, -nl unsets
  804. X            inlcr, igncr, ocrnl, and onlret.
  805. Xlcase (-lcase)        set (unset) xcase, iuclc, and olcuc.
  806. XLCASE (-LCASE)        same as lcase (-lcase)
  807. Xtabs (-tabs or tab3)    preserve (expand to spaces) tabs when printing
  808. Xek            set ERASE and KILL characters back to # and @.
  809. Xsane            reset all modes to some reasonable values
  810. Xterm            set all modes suitable for the terminal type term,
  811. X            where term is one of tty33, tty37, vt05, tn300, ti700,
  812. X            or tek.
  813. X
  814. XIF THIS FLASHED BY QUICKER THAN YOU COULD READ IT, TRY IT AGAIN LIKE THIS:
  815. X
  816. X    help stty | more
  817. X
  818. X# su
  819. Xsu -- become super-user or another user
  820. XUsage:    su [-] [name [arg ...]]
  821. X-    If the first argument to su is `-', the environment will be changed
  822. X    to what it would be if the user actually logged in as "name".
  823. Xname    If name is given, become that user. If no name is given, become
  824. X    root (e.g. the super-user).
  825. Xarg    Optional arguments are passed to the shell invoked by su.
  826. X    Thus, "su - bin -c command args" executes "command" with the temporary
  827. X    environment and permissions of user "bin".
  828. X# tput
  829. Xtput - query terminfo database
  830. XUsage:    tput [-Ttype] capname [parms...]
  831. X-Ttype    indicates the type of terminal. Normally unnecessary, since
  832. X    the default is taken from the environment variable TERM.
  833. Xcapname    indicates the attribute (capabilitry) from the terminfo database
  834. Xparms    if the capability needs parameters, the argument parms will be
  835. X    instantiated into the string.
  836. X# troff
  837. Xtroff, ditroff -- text formatter for typesetters and other high-resolution
  838. X          output devices
  839. XUsage:    troff [options] [files]
  840. X-o list    Print only pages whose numbers appear in "list".
  841. X-nN    Number first page generated N.
  842. X-sN    Generate output to encourage typesetter to stop every N pages
  843. X-mname    Prepend the macro file /usr/lib/tmac/tmac.name to the input files.
  844. X-raN    Set register a (one-character name) to N.
  845. X-i    Read standard input after the input files are exhausted.
  846. X-q    Invoke the simultaneous input-output mode of the .rd request
  847. X-z    Print only messages generated by the .tm request
  848. X-a    Send a printable ASCII approximation of the results to the standard
  849. X    output.
  850. X-Tdest    Prepare output for typesetter dest. 
  851. X# true
  852. Xtrue, : , false -- provide truth values
  853. XUsage:    : [argument ...]
  854. X    true [argument ...]
  855. X    false
  856. XTrue and : do nothing, successfully. False does nothing, unsuccessfully.
  857. X: is also used as a magic number for Bourne or Korn shell scripts in a
  858. XC-Shell environment.
  859. X# tty
  860. Xtty -- get name of terminal
  861. XUsage:    tty [-l] [-s]
  862. X-l    print synchronous line number if the terminal is on an active
  863. X    synchronous line
  864. X-s    prevent printing of tty pathname, return result as a return code.
  865. X    2 - invalid options; 0 - if tty is a terminal; 1 - otherwise
  866. X# umask
  867. Xumask -- set file-creation mode mask
  868. XUsage:    umask [ooo]
  869. XWithout an argument, umask prints the current value of the mask.
  870. XWith argument, umask sets the mask to the value specified by the three-digit
  871. Xoctal number. See help entry for chmod for legal values.
  872. X# write
  873. Xwrite -- write to another user
  874. XUsage:    write user [line]
  875. XIf you want to write to a user who is logged in more than once,  the 
  876. X"line" argument may be used to direct which terminal to write to.
  877. XPermission to write may be denied or granted by the use of mesg(1).
  878. XDuring a write session, a line starting with ! will cause the rest
  879. Xof that line to be passed to the shell as a command.
  880. XTerminate a write session with your INTR or EOF character.
  881. X
  882. END_OF_helpfile
  883. if test 19018 -ne `wc -c <helpfile`; then
  884.     echo shar: \"helpfile\" unpacked with wrong size!
  885. fi
  886. # end of overwriting check
  887. fi
  888. if test -f info -a "${1}" != "-c" ; then 
  889.   echo shar: Will not over-write existing file \"info\"
  890. else
  891. echo shar: Extracting \"info\" \(135 characters\)
  892. sed "s/^X//" >info <<'END_OF_info'
  893. X:
  894. X# info - shellscript to use help command as a notebook lookup
  895. Xexport HELPDIR HELPFILE
  896. XHELPDIR=$HOME
  897. XHELPFILE=$HOME/.notebook
  898. Xhelp $1
  899. END_OF_info
  900. if test 135 -ne `wc -c <info`; then
  901.     echo shar: \"info\" unpacked with wrong size!
  902. fi
  903. # end of overwriting check
  904. fi
  905. echo shar: End of shell archive.
  906. exit 0
  907.